package com.xhh.nphm.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xhh.nphm.system.domain.TmSysNoticeLog;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface TmSysNoticeLogDao extends BaseMapper<TmSysNoticeLogDao> {
    /**
     * 添加访问记录
     */
    @Insert("insert into tm_sys_notice_log(UserId, affId, logTime) values (#{userId},#{affId},#{logTime})")
    int addLog(TmSysNoticeLog tmSysNoticeLog);
    /**
     * 查询是否存在该条访问记录
     */
    @Select("select * from tm_sys_notice_log where UserId = #{userId} and isDelFlag = 0 and affId = #{affId}")
    TmSysNoticeLog selectByUserIdAndAffId(@Param("userId") Long userId, @Param("affId") int affId);
}
